<?php

class User extends CActiveRecord {

    const FIELD_LOGIN = "login";
    const FIELD_PASSWORD = "password";
    const IDENTITY_SALT = "some secret string for password";

   	/**
	 * Returns the static model of the specified AR class.
	 * @return Users the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'is_users';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('login, email, show_name', 'length', 'max'=>255),
			array('password', 'length', 'max'=>32),
			array('passkey', 'length', 'max'=>32),
			array('role', 'length', 'max'=>45),
			array('active', 'numerical', 'integerOnly'=>true),
	    );
	}
}
